//
//  MyCLController.h
//  UserLocation
//
//  Created by Jason Liu on 11-10-20.
//  Copyright (c) 2011年 Yulong. All rights reserved.
//
/*
 MyCLController used to locate user position, 2 case
 
 if location service is enabled, then get value;
 - (void)locationUpdate:(CLLocation *)location; 
 
 else locaton service is not enabled, thren return CLLocationCoordinate2DMake(0, 0)
 - (void)locationError:(NSError *)error;

 */
#import <CoreLocation/CoreLocation.h>
#define MAX_TIME	60
#define BEST_ACCURACY	200
@protocol MyCLControllerDelegate <NSObject>
@required
- (void)locationUpdate:(CLLocation *)location; 
@optional
- (void)locationError:(NSError *)error; 
- (void)locationFinished:(CLLocation *)location;
- (void)locationTimeOut:(CLLocation *)location;
@end

#import <Foundation/Foundation.h>

@interface MyCLController : NSObject <CLLocationManagerDelegate> {
    CLLocationManager *locationManager;
    id delegate;
    // 精度变量
    double accuracy;
    // 超时变量
    float timeOut;
    // 同个地方附近计数
//    int sameStationCount;
    
    
    CLLocation *currentLocation;
//	int intLocateTimes;
//	int intMaxNumber;
//	BOOL blnFinished;
//	CLLocation *bestLocation;
}
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) CLLocation *currentLocation;
@property (nonatomic, assign) id <MyCLControllerDelegate> delegate;
//@property (nonatomic, assign) int intLocateTimes;
//@property (nonatomic, assign) int intMaxNumber;
//@property (nonatomic, assign) BOOL blnFinished;
//@property (nonatomic, retain) CLLocation *bestLocation;

-(void)startLocate;
//-(void)startQuickLocate;
-(void)timeOver;
-(void)stopLocate;
@end
